home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 7674 < prev    next >
Encoding:
Text File  |  1996-08-05  |  2.1 KB  |  68 lines

  1. Path: news.NetVision.net.il!news
  2. From: koz@netvision.net.il
  3. Newsgroups: comp.lang.c++,comp.lang.c
  4. Subject: Re: Increasing stack size - HELP!
  5. Date: Sun, 25 Feb 96 00:23:09 PDT
  6. Organization: NetVision LTD.
  7. Message-ID: <NEWTNews.825237165.25683.koz@dialup.netvision.net.il>
  8. References: <4gcd0h$8rf@izar.brunel.ac.uk>
  9. NNTP-Posting-Host: ts006p3.pop3a.netvision.net.il
  10. Mime-Version: 1.0
  11. Content-Type: TEXT/PLAIN; charset=US-ASCII
  12. X-Newsreader: NEWTNews & Chameleon -- TCP/IP for MS Windows from NetManage
  13.  
  14.  
  15. In Article<4gcd0h$8rf@izar.brunel.ac.uk>, <mapgfgf@brunel.ac.uk> write:
  16. > Path: 
  17. news.NetVision.net.il!psinntp!psinntp!psinntp!howland.reston.ans.net!tank.news.
  18. pipex.net!pipex!sunsite.doc.ic.ac.uk!nntp0.brunel.ac.uk!usenet
  19. > From: Francesco Fantauzzi <mapgfgf@brunel.ac.uk>
  20. > Newsgroups: comp.lang.c++,comp.lang.c
  21. > Subject: Increasing stack size - HELP!
  22. > Date: 20 Feb 1996 11:58:09 GMT
  23. > Organization: Brunel University
  24. > Lines: 18
  25. > Message-ID: <4gcd0h$8rf@izar.brunel.ac.uk>
  26. > NNTP-Posting-Host: maths-pc-125.brunel.ac.uk
  27. > Mime-Version: 1.0
  28. > Content-Type: text/plain; charset=us-ascii
  29. > Content-Transfer-Encoding: 7bit
  30. > X-Mailer: Mozilla 1.22 (Windows; I; 16bit)
  31. > Xref: news.NetVision.net.il comp.lang.c++:5178 comp.lang.c:4340
  32. > Hi All!
  33. > I'm using Borland C++ 4.0. I'm stuck 'cause, when I run my program, it 
  34. > stops with a run-time error: "STACK OVERFLOW!". 
  35. > I checked the stack size (with stackavail()) and it's actually too small. 
  36. > How can I tell the compiler that I would like a larger stack, overriding 
  37. > the default size? I'm sure there's a way: I did it years ago, but have 
  38. > forgotten it. 
  39. > BTW, I'm writing a plain MS-DOS application with the compact memory 
  40. > model.
  41. > Thanks for any help.
  42. > Francesco G. Fantauzzi
  43. Just use the next line :
  44.  
  45. extern unsigned _stklen = NewStackSize;
  46.  
  47. (It should be writen in the global section of the program, not in 
  48. ANY procedure).
  49.  
  50. Set the NewStackSize to the needed space.
  51.  
  52. Its default is 4k. its minimum is 128 bytes, and the maximum depends on your 
  53. model, in your compact model : 
  54. Stack+Static Data should not exceed 64k.
  55.  
  56. Check out the help file, dealing with global vars for more info.
  57.  
  58. bye, Saar.
  59.  
  60.